package com.paimai.pojo;

import java.io.Serializable;

/**
 * 创建人：常亮
 * 创建模板：2022/9/2416:14
 * 描述：
 */
public class PageResult implements Serializable {
    private Integer code;//404找不到 500内容错误 200正常
    private String msg;//直接的消息结果
    private Object result;//执行方法的结果

    public PageResult(Integer code, String msg, Object result) {
        this.code = code;
        this.msg = msg;
        this.result = result;
    }

    public PageResult() {
    }

    public static PageResult success(String msg, Object object){
        return  new PageResult(200,msg,object);
    }
    public static PageResult error(){
        return new PageResult(500,"异常",null);
    }
    public static PageResult none(String msg){
        return new PageResult(100,msg,null);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
